package com.ssps.utils;

import org.springframework.scheduling.annotation.Scheduled;
import org.springframework.stereotype.Component;

import javax.annotation.Resource;

/**
 * @author li
 * @time 2020/07/24 17:41:10
 */

@Component
public class MyJob {
    @Resource
    private BackUpSql backUpSql;

    //每天凌晨备份一次
    @Scheduled(cron="0 0 0 * * ?")
    public void dox(){
        try {
            backUpSql.backUp();
        } catch (Exception e) {
            e.printStackTrace();
        }
        System.out.println("hello-------------------");
    }
}
